<div class="subject">
<h2>View Subject</h2>

	<dl>
		<dt>Id</dt>
		<dd>&nbsp;<?php echo $subject['Subject']['id']?></dd>
		<dt>Name</dt>
		<dd>&nbsp;<?php echo $subject['Subject']['name']?></dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link('Edit Subject',   array('action'=>'edit', $subject['Subject']['id'])); ?> </li>
		<li><?php echo $html->link('Delete Subject', array('action'=>'delete', $subject['Subject']['id']), null, 'Are you sure you want to delete #' . $subject['Subject']['id'] . '?'); ?> </li>
		<li><?php echo $html->link('List Subjects', array('action'=>'index')); ?> </li>
		<li><?php echo $html->link('New Subject',	array('action'=>'add')); ?> </li>
	</ul>

</div>
<div class="related">
<h3>Related Posts</h3>
<?php if(!empty($subject['Post'])):?>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th>Id</th>
		<th>Title</th>
		<th>Byline</th>
		<th>Body</th>
		<th>User Id</th>
		<th>Subject Id</th>
		<th>Url</th>
		<th>Published</th>
		<th>Created</th>
		<th>Modified</th>
		<th>Actions</th>
	</tr>
<?php foreach($subject['Post'] as $post):?>
	<tr>
		<td><?php echo $post['id'];?></td>
		<td><?php echo $post['title'];?></td>
		<td><?php echo $post['byline'];?></td>
		<td><?php echo $post['body'];?></td>
		<td><?php echo $post['user_id'];?></td>
		<td><?php echo $post['subject_id'];?></td>
		<td><?php echo $post['url'];?></td>
		<td><?php echo $post['published'];?></td>
		<td><?php echo $post['created'];?></td>
		<td><?php echo $post['modified'];?></td>
		<td class="actions">
			<?php echo $html->link('View', array('controller'=> 'posts', 'action'=>'view', $post['id'])); ?>
			<?php echo $html->link('Edit', array('controller'=> 'posts', 'action'=>'edit', $post['id'])); ?>
			<?php echo $html->link('Delete', array('controller'=> 'posts', 'action'=>'delete', $post['id']), null, 'Are you sure you want to delete #' . $post['id'] . '?'); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>

<div class="actions">
		<ul>
			<li><?php echo $html->link('New Post', array('controller'=> 'posts', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
